package com.lqd.mall.basis.exception;

import com.lqd.mall.basis.code.ResultCode;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author 零起点
 * @create 2022-01-12 10:45
 */
@Getter
@NoArgsConstructor
public class CustomException extends RuntimeException {
    /**
     * 错误信息
     */
    ResultCode resultCode;

    public CustomException(ResultCode resultCode){
        super("错误代码:" + resultCode.code() + "错误信息:" + resultCode.message());
        this.resultCode = resultCode;
    }

    public CustomException(String message) {
        super("错误信息:" +message);
    }
}
